<%@ page pageEncoding="UTF-8"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<jsp:include page="common/header.jsp"></jsp:include>
<style>
.bloc .tab_edit{float:left;width:100%;border:2px solid #ccc;height:50px;margin-bottom:20px;margin-top:2px;}
.bloc .tab_edit li{float:left;width:24.9%;}
.bloc .tab_edit li:hover,.bloc .tab_edit li.current{background:#ccc;}
.bloc .tab_edit a{float:left;display:block;width:100%;text-align:center;border-right:2px solid #ccc;height:50px;text-decoration:none;color:#333 !important;font-size:16px;font-weight:bold;line-height:50px;}
.bloc .tab_edit a:hover{text-decoration:none !important;}
#twitterlist img{margin:13px !important;}
.input input{color:#333 !important;font-weight:normal !important;cursor:auto !important;text-shadow:none !important;}
.input input:hover{background:#fff !important;}
</style>
<input type="hidden" name="projectName" id="projectName" value="${pageContext.request.contextPath }"/>
<h1>
	<img src="${pageContext.request.contextPath}/views/images/icons/posts.png" alt="" /> 商品包邮设置
</h1>
<div class="bloc">
	<div id="fadecon">
	<div class="submit">
		<div class="content">
			<form   action="${pageContext.request.contextPath}/admin-gftgoods/saveFreeExpress" onsubmit="return checkForm();" method="post">
				<input type="hidden" name="id" value="${id}"/>
						<div class="input">
						<label for="input1">商品名称</label>
							<input type="text" name="goodsName" id="goodsId" value="${goodsName }" readonly="readonly"/>
						</div>
						<div class="input">
						<label for="input1">是否包邮</label>
							<select id="isFree" name="isFree" onchange="changeSelect();">
								<option value="1" <c:if test="${isFree == 1 }">selected="selected"</c:if> >是</option>
								<option value="0" <c:if test="${isFree == 0 }">selected="selected"</c:if>>否</option>
							</select>
						</div>
						<c:if test="${isFree == 0 }">
							<div id="param" <c:if test="${isFree == 0 }"> style="display: none;"</c:if>>
						</c:if>
							<div class="input">
							<label for="input1">包邮箱数</label>
								<input type="number" min="1" name="fullNum" id="fullNum" value="${fullNum != null ? fullNum : '' }"/>
							</div>
							<div class="input">
							<label for="input1">包邮罐数</label>
								<input type="number" min="1" name="singleNum" id="singleNum" value="${singleNum != null ? singleNum : '' }"/>
							</div>
						</div>
				<div class="submit" style="margin-top: 20px;">
					<input type="submit" value="修改" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="reset" value="取消" class="white" onClick="javascript :history.go(-1);"/>
				</div>
			</form>
		</div>
	</div>
</div>	
	
</div>
<script type="text/javascript">
var curPageName = "admin-gftgoods";
changeCurrent();




function checkForm(){
	var isFree = $("#isFree").val();
	if(isFree == 1 && $.trim($("#fullNum").val()) == '' && $.trim($("#singleNum")).val() == ''){
		myAlert("请至少设置一项包邮参数");
		return false;
	}
	return true;
}

function changeSelect(){
	var isFree = $("#isFree").val();
	if(isFree == 0){
		$("#param").hide();
	}else{
		$("#param").show();
	}
}
</script>
